package com.yzh.book.controller;

import com.yzh.book.model.BookInfo;
import com.yzh.book.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/book")
public class BookController {


//  存  loC: @Component @Controller  控制反转
//  取  Dl:  @Autowired              依赖注入
@Autowired
//从Spring中拿对象`
    private BookService bookService;

    @RequestMapping("/getBookList")
    public List<BookInfo> getBookList() {
        return bookService.getBookList();
    }

    @RequestMapping("/getBookList2")
    public List<BookInfo> getBookList2() {
        return bookService.getBookList();
    }
}
